'''
Author: your name
Date: 2020-11-04 11:45:36
LastEditTime: 2020-11-05 11:15:17
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \python-study\djangoS\HelloWorld\TestModel\models.py
'''
from django.db import models

# Create your models here.
class Test(models.Model):
    name = models.CharField(max_length=20)

class Contact(models.Model):
    name   = models.CharField(max_length=200)
    age    = models.IntegerField(default=0)
    email  = models.EmailField()
    def __unicode__(self):
        return self.name

class Tag(models.Model):
    contact = models.ForeignKey(Contact, on_delete=models.CASCADE,)
    name    = models.CharField(max_length=50)
    def __unicode__(self):
        return self.name